]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Don't remove the active workspace
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 30 Sep 2013 17:59:09 +0000 (19:59 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 19 Feb 2014 20:52:52 +0000 (21:52 +0100)
Currently workspaces (except for the last one) are removed when
they become empty. While we do have special treatment for the
case where the currently active workspace is removed, we just
move directly without animations to the last workspace to avoid
ending up on a "random" workspace. However this behavior is still
a bit confusing, so keep the workspace around instead until the
user decides to move to another one.

https://bugzilla.gnome.org/show_bug.cgi?id=709064

js/ui/windowManager.js

index 4c7cac468bb65dc5801e5c4ffd96c2da8846d80b..cf802900509fdcb5fa62f2c69e43ddccc8a03b25 100644 (file)
@@ -191,6 +191,7 @@ const WorkspaceTracker = new Lang.Class({
         tracker.connect('startup-sequence-changed', Lang.bind(this, this._queueCheckWorkspaces));
 
         global.screen.connect('notify::n-workspaces', Lang.bind(this, this._nWorkspacesChanged));
+        global.window_manager.connect('switch-workspace', Lang.bind(this, this._queueCheckWorkspaces));
 
         global.screen.connect('window-entered-monitor', Lang.bind(this, this._windowEnteredMonitor));
         global.screen.connect('window-left-monitor', Lang.bind(this, this._windowLeftMonitor));
@@ -249,13 +250,7 @@ const WorkspaceTracker = new Lang.Class({
         }
 
         let activeWorkspaceIndex = global.screen.get_active_workspace_index();
-        let removingCurrentWorkspace = (emptyWorkspaces[activeWorkspaceIndex] &&
-                                        activeWorkspaceIndex < emptyWorkspaces.length - 1);
-
-        if (removingCurrentWorkspace) {
-            // "Merge" the empty workspace we are removing with the one at the end
-            this._wm.blockAnimations();
-        }
+        emptyWorkspaces[activeWorkspaceIndex] = false;
 
         // Delete other empty workspaces; do it from the end to avoid index changes
         for (i = emptyWorkspaces.length - 2; i >= 0; i--) {
@@ -263,11 +258,6 @@ const WorkspaceTracker = new Lang.Class({
                 global.screen.remove_workspace(this._workspaces[i], global.get_current_time());
         }
 
-        if (removingCurrentWorkspace) {
-            global.screen.get_workspace_by_index(global.screen.n_workspaces - 1).activate(global.get_current_time());
-            this._wm.unblockAnimations();
-        }
-
         this._checkWorkspacesId = 0;
         return false;
     },